<template>
	<view class="page">
		<view class="detail-box-item">
			<view class="title">
				基础信息
			</view>
			<view class="content-box">
				<view class="cell-item">
					<view class="left-box">
						采购员编号
					</view>
					<view class="right-box">
						cfg12d456d456465sfa
					</view>
				</view>
				<view class="cell-item">
					<view class="left-box">
						采购优先级
					</view>
					<view class="right-box">
						1级紧急
					</view>
				</view>
				<view class="cell-item">
					<view class="left-box">
						采购订单状态
					</view>
					<view class="right-box">
						待审核
					</view>
				</view>
				<view class="cell-item">
					<view class="left-box">
						申请时间
					</view>
					<view class="right-box">
						2022-04-11 16:46:53
					</view>
				</view>
			</view>
		</view>
		<view class="detail-box-item">
			<view class="title">
				采购申请人信息
			</view>
			<view class="info-item">
				<view class="left-box">
					<image class="user-icon" src="/static/image/people_icon.png" mode="aspectFit"></image>
					<view class="info-message">
						<view class="name">
							杨雪婷 133333333333
						</view>
						<view class="address">
							施工方哈迪斯规划局卡话感觉卡萨户籍卡
						</view>
					</view>
					
				</view>
				<view class="right-box">
					<image class="phone-icon" src="/static/image/order/phone_icon.png" mode="aspectFit"></image>
				</view>
			</view>
		</view>
		<view class="detail-box-item">
			<view class="title">
				采购物料
			</view>
			<view class="card-item">
				<view class="product-item">
					<view class="img-box">
						<image class="img" src="/static/image/img_icon.png" mode="aspectFit"></image>
					</view>
					<view class="right-box">
						<view class="product-title">
							11原
						</view>
						<view class="product-id">
							WL533253278529375839257
						</view>
						<view class="size">
							大小：6/重量：12
						</view>
						<view class="sign">
							件
						</view>
					</view>
				</view>
				<view class="table-box">
					<view class="table-row">
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									请购数：
								</view>
								<view class="table-value">
									<view class="num">
										10
									</view>
									<view class="sign">
										/件
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									提购数：
								</view>
								<view class="table-value">
									<view class="num">
										12
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									提购价格：
								</view>
								<view class="table-value">
									<view class="num">
										22.44
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="table-row">
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									含税单价：
								</view>
								<view class="table-value">
									<view class="num">
										22.44
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									含税总价：
								</view>
								<view class="table-value">
									<view class="num">
										269.44
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									税率：
								</view>
								<view class="table-value">
									<view class="num">
										0.02
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="table-row">
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									不含税单价：
								</view>
								<view class="table-value">
									<view class="num">
										22
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									不含税总价：
								</view>
								<view class="table-value">
									<view class="num">
										269.44
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="table-row">
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									含税单价：
								</view>
								<view class="table-value">
									<view class="num">
										22.44
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									含税总价：
								</view>
								<view class="table-value">
									<view class="num">
										269.44
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									税率：
								</view>
								<view class="table-value">
									<view class="num">
										0.02
									</view>
								</view>
							</view>
						</view>
					</view>
					<view class="table-row">
						<view class="table-item">
							<view class="item-value">
								<view class="table-title">
									项目名称：
								</view>
								<view class="table-value">
									<view class="num">
										搞懂还是结果还独守空闺户籍卡
									</view>
								</view>
							</view>
						</view>
						<view class="table-item">
						</view>
						<view class="table-item">
							<view class="item-value">
							<view class="table-value">
								<view class="num">
									杨雪婷
								</view>
							</view>
							</view>
						</view>
					</view>
				</view>
				
				<view class="item-value">
					<view class="table-title">
						期望到货时间：
					</view>
					<view class="table-value">
						<view class="num" style="color:red;">
							2022-04-11
						</view>
					</view>
				</view>
				<view class="button" @click="batchTap">
					查看批次
				</view>
			</view>
		</view>
		<view class="detail-box-item">
			<view class="title">
				 物料收货人信息
			</view>
			<view class="info-item">
				<view class="left-box">
					<image class="user-icon" src="/static/image/people_icon.png" mode="aspectFit"></image>
					<view class="info-message">
						<view class="name">
							杨雪婷 133333333333
						</view>
						<view class="address">
							施工方哈迪斯规划局卡话感觉卡萨户籍卡
						</view>
					</view>
					
				</view>
				<view class="right-box">
					<image class="phone-icon" src="/static/image/order/phone_icon.png" mode="aspectFit"></image>
				</view>
			</view>
		</view>
		<view class="cell-item">
			<view class="left-box">
				收货记录
			</view>
			<view class="right-box">
				查看
			</view>
		</view>
		<view class="cell-item">
			<view class="left-box">
				退货记录
			</view>
			<view class="right-box">
				查看
			</view>
		</view>
		<view class="clearbottom"></view>
		<view class="button-box">
			<view class="button reject" @click="rejectTap">
				申请退货
			</view>
			<view class="button agree" @click="agreeTap">
				完成收货
			</view>
			<view class="button agree" @click="agreeTap">
				签收物料
			</view>
		</view>
		<!-- <view class="reject-reason-box">
			<view class="left-box">
				退回原因
			</view>
			<view class="right-box">
				更多开始几个单身
			</view>
		</view> -->
		<remark v-if="remarkType" title="退回原因" @cancel="rejectCancel"></remark>
		<batch v-if="batchType" @close="batchClose"></batch>
	</view>
</template>

<script>
	import remark from '@/pages/mask/component/remark/remark';
	import batch from '@/subcontractList/order/purchase/component/dialog/batch';
	export default {
		components:{
			remark,batch
		},
		data() {
			return {
				remarkType:false, // 拒绝原因弹窗显示状态
				batchType:false,// 批次弹窗显示状态
			}
		},
		methods: {
			rejectTap:function(){
				this.remarkType = true;
			},
			rejectCancel:function(){
				this.remarkType = false;
			},
			agreeTap:function(){
				uni.showModal({
					title: '提示',
					content: '确认通过？',
					success: function (res) {
						if (res.confirm) {
							console.log('用户点击确定');
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			batchTap:function(){
				this.batchType = true;
			},
			batchClose:function(){
				this.batchType = false;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		background-color: #eaeaea;
		min-height: 100vh;
	}

	.detail-box-item {
		box-sizing: border-box;

		.title {
			font-size: 32rpx;
			font-weight: bold;
			padding: 20rpx;
			padding-left: 20rpx;
			margin-left: 20rpx;
			position: relative;
			line-height: 60rpx;
		}

		.title::after {
			content: '';
			width: 6rpx;
			top: 35%;
			height: 30%;
			position: absolute;
			left: 0;
			background-color: #29ac7a;
		}

		.content-box {
			background-color: white;
			padding: 0 20rpx;

			.cell-item {
				display: flex;
				justify-content: space-between;
				line-height: 60rpx;
				font-size: 28rpx;

				.left-box {
					color: #818181;
				}
			}
		}

		.card-item {
			width: calc(100% - 40rpx);
			margin: 0 auto;
			box-sizing: border-box;
			background-color: white;
			padding: 20rpx;
			position: relative;
			.product-item {
				display: flex;

				.img-box {
					width: 160rpx;
					height: 160rpx;
					background-color: #eeeeee;
					overflow: hidden;

					.img {
						width: 50%;
						height: 50%;
						display: block;
						margin: 40rpx auto;
					}
				}

				.right-box {
					font-size: 26rpx;
					line-height: 40rpx;
					margin-left: 20rpx;

					.product-title {
						color: #ff5400;
						font-weight: bold;
					}

					.sign {
						color: #634ed1;
					}
				}
			}

			.table-box {
				display: table;
				width: 100%;

				.table-row {
					display: table-row;

					.table-item {
						// width: calc(100% / 3);

						display: table-cell;

					}
				}
			}

			.item-value {
				display: flex;
				font-size: 24rpx;
				line-height: 40rpx;

				.table-title {
					white-space: nowrap;
				}

				.table-value {
					display: flex;

					.num {
						color: #634ed1;
					}
				}
			}
			.button{
				position: absolute;
				bottom: 20rpx;
				right: 20rpx;
				width: fit-content;
				padding: 0 25rpx;
				height:70rpx;
				line-height: 70rpx;
				border-radius: 10rpx;
				color: white;
				font-size: 26rpx;
				text-align: center;
				background-color: #35af86;
			}
		}
		.info-item{
			display: flex;
			justify-content: space-between;
			background-color: white;
			padding:20rpx;
			.left-box{
				display: flex;
				.user-icon{
					width: 70rpx;
					height: 70rpx;
				}
				.info-message{
					font-size: 26rpx;
					color: #888888;
					margin-left:20rpx;
				}
			}
			.right-box{
				.phone-icon{
					width: 70rpx;
					height: 70rpx;
				}
			}
		}
	}
	.cell-item{
		display: flex;
		justify-content: space-between;
		padding: 0 20rpx;
		background-color: white;
		line-height: 70rpx;
		height: 70rpx;
		box-sizing: border-box;
		font-size:28rpx;
		color: #888888;
		margin-top: 20rpx;
	}
	.clearbottom{
		width: 100%;
		height: calc(constant(safe-area-inset-bottom) + 120rpx);
		height: calc(env(safe-area-inset-bottom) + 120rpx);
	}
	.button-box{
		display: flex;
		width: calc(100% - 40rpx);
		position: fixed;
		left:0;
		bottom:0;
		padding:20rpx;
		padding-bottom: calc(constant(safe-area-inset-bottom) + 20rpx);
		padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
		background-color: #eaeaea;
		.button{
			color: white;
			border-radius: 10rpx;
			line-height: 70rpx;
			height: 70rpx;
			width: calc(100% - 10rpx);
			text-align: center;
			margin-right: 20rpx;
		}
		.reject{
			background-color: #afafaf;
		}
		.agree{
			background-color: #4169e2;
		}
		.button:last-child{
			margin-right: 0;
		}
	}
	.reject-reason-box{
		display: flex;
		position: fixed;
		width: 100%;
		left:0rpx;
		padding: 0 20rpx;
		box-sizing: border-box;
		bottom: calc(constant(safe-area-inset-bottom));
		bottom: calc(env(safe-area-inset-bottom));
		background-color: white;
		justify-content: space-between;
		line-height:80rpx;
		font-size: 28rpx;
	}
</style>
